package com.alpha.processor.util;

import javax.lang.model.type.TypeMirror;

public class TypeParametersUtil {
    public static String[] getSplitArray(TypeMirror typeMirror){
        String mirrorStr = typeMirror.toString();
        int start = mirrorStr.indexOf("<");
        int end = mirrorStr.indexOf(">");
        if (start == -1 || end == -1){
            return null;
        }
        String parametersStr = mirrorStr.substring(start + 1,end);
        return parametersStr.replaceAll(" ","").split(",");
    }
}
